package 集合.day2.demo7;

import 集合.day2.demo5.Stu;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Test1 {
    public static void main(String[] args) {
        List list=new ArrayList<>();
        list.add(new Stu(4,"a1"));
        list.add(new Stu(3,"a3"));
        list.add(new Stu(5,"a5"));

        System.out.println(list);
        Collections.sort(list);
        System.out.println(list);
        System.out.println(Collections.max(list));
        Collections.reverse(list);
        System.out.println(list);
    }

}
